Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Discord bot logic to split response messages in paragraphs #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LuchoAravena
Copy link
Collaborator

On this PR a new logic was implemented to split OpenAI image review response into paragraphs to avoid Discord API error with characters. ({"message": {"code": 50035, "errors": {"content": {"_errors": [{"code": "BASE_TYPE_MAX_LENGTH", "message": "Must be 2000 or fewer in length."}]}}, "message": "Invalid Form Body"}, "status_code": 400})

Now:

  • The OpenAI image review response generates review key with --PARAGRAPH-- word, so that afterward,
  • Discord Utils splits every two paragraphs with --PARAGRAPH-- and sends each split to private message, avoiding the Discord API error

@LuchoAravena LuchoAravena added the 🐞 Bug Something isn't working label Oct 25, 2024
@LuchoAravena LuchoAravena self-assigned this Oct 25, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11525559470

Details

  • 16 of 16 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 99.621%

Totals Coverage Status
Change from base Build 11244485946: 0.03%
Covered Lines: 3417
Relevant Lines: 3430

💛 - Coveralls

Copy link
Collaborator

@FelipeGuzmanSierra FelipeGuzmanSierra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants